# LuckPay Web Manage System
#
# Copyright (c) 2016 Lucky Byte, Inc.
#
$ ->
    # 表单字段验证
    form = $('form.main')
    form.form
        inline: true,
        fields:
            name: 'empty',
            cron: 'empty',
            engine: 'empty',
            script: 'empty'

    form.find('.trigger.button').click ->
        $this = $(this)
        $this.addClass 'loading'
        $.post '/sched/trigger', {
            serial: form.form 'get value', 'serial'
        }, (resp) ->
            $this.removeClass 'loading'
